<script src="<?php print $url?>js/data-table.jquery.js"></script>
<script>
  $(function () {
    $('.data-tbl-boxy').dataTable({
        "sPaginationType": "full_numbers",
        "iDisplayLength": 10,
        "oLanguage": {
            "sLengthMenu": "<span class='lenghtMenu'> _MENU_</span><span class='lengthLabel'>Entries per page:</span>",
        },
        "sDom": '<"tbl-searchbox clearfix"fl<"clear">>,<"table_content"t>,<"widget-bottom"p<"clear">>'

    });
  });
</script>
<div id="main-content">
  <div class="container-fluid">
    <div class="row-fluid">
      <div class="span12">
        <div class="widget-block">
          <?php
          if($status == '2'){
          ?>
          <div class="alert alert-error fade in">
            <button data-dismiss="alert" class="close" type="button">×</button>
            <strong><?php print urldecode($pesan)?></strong>
          </div>
          <?php
          }
          if($status == '1'){
          ?>
          <div class="alert alert-success fade in">
            <button data-dismiss="alert" class="close" type="button">×</button>
            <strong><?php print urldecode($pesan)?></strong>
          </div>
          <?php
          }
          ?>
          <div class="widget-head">
            <h5><?php print $title?></h5>
            <div class="widget-control pull-right">
              <a href="#" data-toggle="dropdown" class="btn dropdown-toggle"><i class="icon-cog"></i><b class="caret"></b></a>
              <ul class="dropdown-menu">
                <li><a href="<?php print   site_url("frm/accounting/add-master-account/") ?>"><i class="icon-plus"></i> Add New</a></li>
<!--                <li><a href="#"><i class="icon-ok"></i> Active</a></li>
                <li><a href="#"><i class="icon-minus-sign"></i> No-Active</a></li>
                <li><a href="#"><i class="black-icons pdf_document"></i> Export to PDF</a></li>-->
                <!--<li><a href="<?php print   site_url("product/export-xls") ?>"><i class="black-icons excel_document"></i> Export to XLS</a></li>-->
              </ul>
            </div>
          </div>
          <div class="widget-content">
            <div class="widget-box">
              <table class="data-tbl-boxy table">
                <thead>
                  <tr>
                    <th>No Akun</th>
                    <th>Group</th>
                    <th>Name</th>
                    <th>Kelompok</th>
                    <th>Pos</th>
                    <th>Status <br />Laba/Rugi</th>
                    <th>Status <br />Modal</th>
                    <th>Option</th>
                  </tr>
                </thead>
                <tbody>
                  <?php
                  if(is_array($data)){
                    foreach ($data as $key => $value) {
                      $link_edit = site_url("frm/accounting/add-master-account/".$value->id_frm_account);
//                      $link_delete = site_url("keuangan/add-akun/".$outlet[0]->id_outlet."/".$value->id_akun);
                      if($value->pos == 1)
                        $rt = "Debit";
                      else
                        $rt = "Kredit";
                      
                      $name = $value->title;
                      if($value->parent < 1)
                        $name = "<b>{$value->title}</b>";
                        
                      $labarugi = $modal = "<img src='{$url}img/cross_button.png' />";
                      if($value->labarugi == 2)
                        $labarugi = "<img src='{$url}img/checked.png' />";
                        
                      if($value->modal == 2)
                        $modal = "<img src='{$url}img/checked.png' />";
                        
                      print "
                  <tr>
                    <td>{$value->nomor}</td>
                    <td>{$this->global_models->get_field("frm_account", "title", array("id_frm_account" => $value->parent_view))}</td>
                    <td>{$name}</td>
                    <td>{$this->global_models->get_field("frm_account", "title", array("id_frm_account" => $value->parent))}</td>
                    <td>{$rt}</td>
                    <td>{$labarugi}</td>
                    <td>{$modal}</td>
                    <td>
                      <div class='btn-group'>
                        <button data-toggle='dropdown' class='btn btn-small dropdown-toggle'>Action<span class='caret'></span></button>
                        <ul class='dropdown-menu'>
                          <li><a href='{$link_edit}'>Edit</a></li>
                        </ul>
                      </div>
                    </td>
                  </tr>"
                  ;
                    }
                  }
                  ?>
                </tbody>
              </table>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>